using System; 
using System.Collections.Generic; 
using System.Text; 
using FluentNHibernate.Mapping;
using Managistics.Model; 

namespace Managistics.Model.Mappings {
    
    
    public class OrderNhanhNhanhMap : ClassMap<OrderNhanhNhanh> {
        
        public OrderNhanhNhanhMap() {
			Table("ORDER_NHANH_NHANH");
			LazyLoad();
			Id(x => x.OrderidNn).GeneratedBy.Assigned().Column("ORDERID_NN");
			References(x => x.Employees).Column("EMPLOYEEID");
			References(x => x.Suppliers).Column("SUPPLIERID");
			Map(x => x.OrderdateNn).Column("ORDERDATE_NN").Not.Nullable();
			Map(x => x.RequestdateNn).Column("REQUESTDATE_NN");
			Map(x => x.ShippingDateNn).Column("SHIPPING_DATE_NN").Not.Nullable();
			Map(x => x.ShipAddressNn).Column("SHIP_ADDRESS_NN").Length(250);
			Map(x => x.StatusNn).Column("STATUS_NN").Not.Nullable();
			Map(x => x.NoteNn).Column("NOTE_NN").Length(200);
			Map(x => x.CompleteDatePo).Column("COMPLETE_DATE_PO");
			Map(x => x.TypeVat).Column("TYPE_VAT").Precision(5);
			Map(x => x.PayCondition).Column("PAY_CONDITION").Length(50);
			Map(x => x.NumInput).Column("num_input").Not.Nullable().Precision(5);
			Map(x => x.NumReturn).Column("num_return").Not.Nullable().Precision(5);
			Map(x => x.Discount).Column("Discount").Not.Nullable().Precision(53);
			HasMany(x => x.DetailOrderNn).KeyColumn("ORDERID_NN");
			HasMany(x => x.InputSheetDomestic).KeyColumn("ORDERID_NN");
			HasMany(x => x.InputSheetOversea).KeyColumn("ORDERID_NN");
			HasMany(x => x.ReturnItemNn).KeyColumn("ORDERID_NN");
        }
    }
}
